home *** CD-ROM | disk | FTP | other *** search
/ Delphi Magazine Collection 2001 / Delphi Magazine Collection 20001 (2001).iso / DISKS / Issue66 / Construc / DrBob42_s.pas < prev    next >
Encoding:
Pascal/Delphi Source File  |  2001-01-03  |  10.7 KB  |  373 lines

  1. unit DrBob42_s;
  2.  
  3. {This file was generated on 29 Dec 2000 10:39:41 GMT by version 03.03.03.C1.06}
  4. {of the Inprise VisiBroker idl2pas CORBA IDL compiler.                        }
  5.  
  6. {Please do not edit the contents of this file. You should instead edit and    }
  7. {recompile the original IDL which was located in the file                     }
  8. {C:\DrBob42\Drbob42.idl.                                                      }
  9.  
  10. {Delphi Pascal unit      : DrBob42_s                                          }
  11. {derived from IDL module : DrBob42                                            }
  12.  
  13.  
  14.  
  15. interface
  16.  
  17. uses
  18.   CORBA,
  19.   DrBob42_i,
  20.   DrBob42_c;
  21.  
  22. type
  23.   TRatesSkeleton = class;
  24.   TAccountSkeleton = class;
  25.   TMyAccountSkeleton = class;
  26.   TADTSkeleton = class;
  27.   TSeqAccountSkeleton = class;
  28.  
  29.   TRatesSkeleton = class(CORBA.TCorbaObject, DrBob42_i.Rates)
  30.   private
  31.     FImplementation : Rates;
  32.   public
  33.     constructor Create(const InstanceName: string; const Impl: Rates);
  34.     destructor Destroy; override;
  35.     function GetImplementation : Rates;
  36.     function  interest_rate : Single;
  37.   published
  38.     procedure _interest_rate(const _Input: CORBA.InputStream; _Cookie: Pointer);
  39.   end;
  40.  
  41.   TAccountSkeleton = class(CORBA.TCorbaObject, DrBob42_i.Account)
  42.   private
  43.     FImplementation : Account;
  44.   public
  45.     constructor Create(const InstanceName: string; const Impl: Account);
  46.     destructor Destroy; override;
  47.     function GetImplementation : Account;
  48.     function  balance : Single;
  49.     function  get_rates ( const myRates : DrBob42_i.Rates): Single;
  50.   published
  51.     procedure _balance(const _Input: CORBA.InputStream; _Cookie: Pointer);
  52.     procedure _get_rates(const _Input: CORBA.InputStream; _Cookie: Pointer);
  53.   end;
  54.  
  55.   TMyAccountSkeleton = class(CORBA.TCorbaObject, DrBob42_i.MyAccount)
  56.   private
  57.     FImplementation : MyAccount;
  58.   public
  59.     constructor Create(const InstanceName: string; const Impl: MyAccount);
  60.     destructor Destroy; override;
  61.     function GetImplementation : MyAccount;
  62.     procedure deposit ( const amount : Single);
  63.     procedure withdraw ( const amount : Single);
  64.     function  balance : Single;
  65.     function  get_rates ( const myRates : DrBob42_i.Rates): Single;
  66.   published
  67.     procedure _deposit(const _Input: CORBA.InputStream; _Cookie: Pointer);
  68.     procedure _withdraw(const _Input: CORBA.InputStream; _Cookie: Pointer);
  69.     procedure _balance(const _Input: CORBA.InputStream; _Cookie: Pointer);
  70.     procedure _get_rates(const _Input: CORBA.InputStream; _Cookie: Pointer);
  71.   end;
  72.  
  73.   TADTSkeleton = class(CORBA.TCorbaObject, DrBob42_i.ADT)
  74.   private
  75.     FImplementation : ADT;
  76.   public
  77.     constructor Create(const InstanceName: string; const Impl: ADT);
  78.     destructor Destroy; override;
  79.     function GetImplementation : ADT;
  80.     procedure test ( const one : DrBob42_i.Identifier;
  81.                      const two : DrBob42_i.EnumType;
  82.                      const three : DrBob42_i.StructType;
  83.                      const four : DrBob42_i.UnionType;
  84.                      const five : DrBob42_i.StructArray;
  85.                      const six : DrBob42_i.StructSequence);
  86.   published
  87.     procedure _test(const _Input: CORBA.InputStream; _Cookie: Pointer);
  88.   end;
  89.  
  90.   TSeqAccountSkeleton = class(CORBA.TCorbaObject, DrBob42_i.SeqAccount)
  91.   private
  92.     FImplementation : SeqAccount;
  93.   public
  94.     constructor Create(const InstanceName: string; const Impl: SeqAccount);
  95.     destructor Destroy; override;
  96.     function GetImplementation : SeqAccount;
  97.     function  balance ( const mySeq : DrBob42_i.IntSeq): Single;
  98.   published
  99.     procedure _balance(const _Input: CORBA.InputStream; _Cookie: Pointer);
  100.   end;
  101.  
  102.  
  103. implementation
  104.  
  105. constructor TRatesSkeleton.Create(const InstanceName : string; const Impl : DrBob42_i.Rates);
  106. begin
  107. //inherited;
  108.   inherited CreateSkeleton(InstanceName, 'Rates', 'IDL:DrBob42/Rates:1.0');
  109.   FImplementation := Impl;
  110. end;
  111.  
  112. destructor TRatesSkeleton.Destroy;
  113. begin
  114.   FImplementation := nil;
  115.   inherited;
  116. end;
  117.  
  118. function TRatesSkeleton.GetImplementation : DrBob42_i.Rates;
  119. begin
  120.   result := FImplementation as DrBob42_i.Rates;
  121. end;
  122.  
  123. function  TRatesSkeleton.interest_rate : Single;
  124. begin
  125.   Result := FImplementation.interest_rate;
  126. end;
  127.  
  128. procedure TRatesSkeleton._interest_rate(const _Input: CORBA.InputStream; _Cookie: Pointer);
  129. var
  130.   _Output : CORBA.OutputStream;
  131.   _Result : Single;
  132. begin
  133.   _Result := interest_rate;
  134.   GetReplyBuffer(_Cookie, _Output);
  135.   _Output.WriteFloat(_Result);
  136. end;
  137.  
  138. constructor TAccountSkeleton.Create(const InstanceName : string; const Impl : DrBob42_i.Account);
  139. begin
  140. //inherited;
  141.   inherited CreateSkeleton(InstanceName, 'Account', 'IDL:DrBob42/Account:1.0');
  142.   FImplementation := Impl;
  143. end;
  144.  
  145. destructor TAccountSkeleton.Destroy;
  146. begin
  147.   FImplementation := nil;
  148.   inherited;
  149. end;
  150.  
  151. function TAccountSkeleton.GetImplementation : DrBob42_i.Account;
  152. begin
  153.   result := FImplementation as DrBob42_i.Account;
  154. end;
  155.  
  156. function  TAccountSkeleton.balance : Single;
  157. begin
  158.   Result := FImplementation.balance;
  159. end;
  160.  
  161. function  TAccountSkeleton.get_rates ( const myRates : DrBob42_i.Rates): Single;
  162. begin
  163.   Result := FImplementation.get_rates( myRates);
  164. end;
  165.  
  166. procedure TAccountSkeleton._balance(const _Input: CORBA.InputStream; _Cookie: Pointer);
  167. var
  168.   _Output : CORBA.OutputStream;
  169.   _Result : Single;
  170. begin
  171.   _Result := balance;
  172.   GetReplyBuffer(_Cookie, _Output);
  173.   _Output.WriteFloat(_Result);
  174. end;
  175.  
  176. procedure TAccountSkeleton._get_rates(const _Input: CORBA.InputStream; _Cookie: Pointer);
  177. var
  178.   _Output : CORBA.OutputStream;
  179.   _myRates : DrBob42_i.Rates;
  180.   _Result : Single;
  181. begin
  182.   _myRates := DrBob42_c.TRatesHelper.Read(_Input);
  183.   _Result := get_rates( _myRates);
  184.   GetReplyBuffer(_Cookie, _Output);
  185.   _Output.WriteFloat(_Result);
  186. end;
  187.  
  188. constructor TMyAccountSkeleton.Create(const InstanceName : string; const Impl : DrBob42_i.MyAccount);
  189. begin
  190. //inherited;
  191.   inherited CreateSkeleton(InstanceName, 'MyAccount', 'IDL:DrBob42/MyAccount:1.0');
  192.   FImplementation := Impl;
  193. end;
  194.  
  195. destructor TMyAccountSkeleton.Destroy;
  196. begin
  197.   FImplementation := nil;
  198.   inherited;
  199. end;
  200.  
  201. function TMyAccountSkeleton.GetImplementation : DrBob42_i.MyAccount;
  202. begin
  203.   result := FImplementation as DrBob42_i.MyAccount;
  204. end;
  205.  
  206. procedure TMyAccountSkeleton.deposit ( const amount : Single);
  207. begin
  208.   FImplementation.deposit( amount);
  209. end;
  210.  
  211. procedure TMyAccountSkeleton.withdraw ( const amount : Single);
  212. begin
  213.   FImplementation.withdraw( amount);
  214. end;
  215.  
  216. function  TMyAccountSkeleton.balance : Single;
  217. begin
  218.   Result := FImplementation.balance;
  219. end;
  220.  
  221. function  TMyAccountSkeleton.get_rates ( const myRates : DrBob42_i.Rates): Single;
  222. begin
  223.   Result := FImplementation.get_rates( myRates);
  224. end;
  225.  
  226. procedure TMyAccountSkeleton._deposit(const _Input: CORBA.InputStream; _Cookie: Pointer);
  227. var
  228.   _Output : CORBA.OutputStream;
  229.   _amount : Single;
  230. begin
  231.   _Input.ReadFloat(_amount);
  232.   deposit( _amount);
  233.   GetReplyBuffer(_Cookie, _Output);
  234. end;
  235.  
  236. procedure TMyAccountSkeleton._withdraw(const _Input: CORBA.InputStream; _Cookie: Pointer);
  237. var
  238.   _Output : CORBA.OutputStream;
  239.   _amount : Single;
  240. begin
  241.   _Input.ReadFloat(_amount);
  242.   try
  243.     withdraw( _amount);
  244.   except on E: UserException do
  245.     begin
  246.       GetExceptionReplyBuffer(_Cookie, _Output);
  247.       E.WriteExceptionInfo(_Output);
  248.       exit
  249.     end;
  250.   end;
  251.   GetReplyBuffer(_Cookie, _Output);
  252. end;
  253.  
  254. procedure TMyAccountSkeleton._balance(const _Input: CORBA.InputStream; _Cookie: Pointer);
  255. var
  256.   _Output : CORBA.OutputStream;
  257.   _Result : Single;
  258. begin
  259.   _Result := balance;
  260.   GetReplyBuffer(_Cookie, _Output);
  261.   _Output.WriteFloat(_Result);
  262. end;
  263.  
  264. procedure TMyAccountSkeleton._get_rates(const _Input: CORBA.InputStream; _Cookie: Pointer);
  265. var
  266.   _Output : CORBA.OutputStream;
  267.   _myRates : DrBob42_i.Rates;
  268.   _Result : Single;
  269. begin
  270.   _myRates := DrBob42_c.TRatesHelper.Read(_Input);
  271.   _Result := get_rates( _myRates);
  272.   GetReplyBuffer(_Cookie, _Output);
  273.   _Output.WriteFloat(_Result);
  274. end;
  275.  
  276. constructor TADTSkeleton.Create(const InstanceName : string; const Impl : DrBob42_i.ADT);
  277. begin
  278. //inherited;
  279.   inherited CreateSkeleton(InstanceName, 'ADT', 'IDL:DrBob42/ADT:1.0');
  280.   FImplementation := Impl;
  281. end;
  282.  
  283. destructor TADTSkeleton.Destroy;
  284. begin
  285.   FImplementation := nil;
  286.   inherited;
  287. end;
  288.  
  289. function TADTSkeleton.GetImplementation : DrBob42_i.ADT;
  290. begin
  291.   result := FImplementation as DrBob42_i.ADT;
  292. end;
  293.  
  294. procedure TADTSkeleton.test ( const one : DrBob42_i.Identifier;
  295.                               const two : DrBob42_i.EnumType;
  296.                               const three : DrBob42_i.StructType;
  297.                               const four : DrBob42_i.UnionType;
  298.                               const five : DrBob42_i.StructArray;
  299.                               const six : DrBob42_i.StructSequence);
  300. begin
  301.   FImplementation.test( one,
  302.                         two,
  303.                         three,
  304.                         four,
  305.                         five,
  306.                         six);
  307. end;
  308.  
  309. procedure TADTSkeleton._test(const _Input: CORBA.InputStream; _Cookie: Pointer);
  310. var
  311.   _Output : CORBA.OutputStream;
  312.   _one : DrBob42_i.Identifier;
  313.   _two : DrBob42_i.EnumType;
  314.   _three : DrBob42_i.StructType;
  315.   _four : DrBob42_i.UnionType;
  316.   _five : DrBob42_i.StructArray;
  317.   _six : DrBob42_i.StructSequence;
  318. begin
  319.   _one := DrBob42_c.TIdentifierHelper.Read(_Input);
  320.   _two := DrBob42_c.TEnumTypeHelper.Read(_Input);
  321.   _three := DrBob42_c.TStructTypeHelper.Read(_Input);
  322.   _four := DrBob42_c.TUnionTypeHelper.Read(_Input);
  323.   _five := DrBob42_c.TStructArrayHelper.Read(_Input);
  324.   _six := DrBob42_c.TStructSequenceHelper.Read(_Input);
  325.   test( _one,
  326.         _two,
  327.         _three,
  328.         _four,
  329.         _five,
  330.         _six);
  331.   GetReplyBuffer(_Cookie, _Output);
  332. end;
  333.  
  334. constructor TSeqAccountSkeleton.Create(const InstanceName : string; const Impl : DrBob42_i.SeqAccount);
  335. begin
  336. //inherited;
  337.   inherited CreateSkeleton(InstanceName, 'SeqAccount', 'IDL:DrBob42/SeqAccount:1.0');
  338.   FImplementation := Impl;
  339. end;
  340.  
  341. destructor TSeqAccountSkeleton.Destroy;
  342. begin
  343.   FImplementation := nil;
  344.   inherited;
  345. end;
  346.  
  347. function TSeqAccountSkeleton.GetImplementation : DrBob42_i.SeqAccount;
  348. begin
  349.   result := FImplementation as DrBob42_i.SeqAccount;
  350. end;
  351.  
  352. function  TSeqAccountSkeleton.balance ( const mySeq : DrBob42_i.IntSeq): Single;
  353. begin
  354.   Result := FImplementation.balance( mySeq);
  355. end;
  356.  
  357. procedure TSeqAccountSkeleton._balance(const _Input: CORBA.InputStream; _Cookie: Pointer);
  358. var
  359.   _Output : CORBA.OutputStream;
  360.   _mySeq : DrBob42_i.IntSeq;
  361.   _Result : Single;
  362. begin
  363.   _mySeq := DrBob42_c.TIntSeqHelper.Read(_Input);
  364.   _Result := balance( _mySeq);
  365.   GetReplyBuffer(_Cookie, _Output);
  366.   _Output.WriteFloat(_Result);
  367. end;
  368.  
  369.  
  370. initialization
  371.  
  372.  
  373. end.